﻿@{
    ViewBag.Title = "用户管理";
}
@using PagedList
@using PagedList.Mvc
@model PagedList.IPagedList<Yitu.Web.ViewModels.UserViewModel>

<div class="pageheader">
    <h2><i class="fa fa-user"></i> 用户管理 </h2>
</div>

<div class="contentpanel">
    <div class="row">
        <div class="table-responsive">
            <table class="table table-hidaction table-hover">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>手机</th>
                        <th>姓名</th>
                        <th>角色</th>
                        <th>省份</th>
                        <th>城市</th>
                        <th>医院</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                  @foreach (var item in Model)
                    {
                        <tr>
                            <td>@item.ID</td>
                            <td>@item.Mobile</td>
                            <td>@item.Name</td>
                            <td>@(item.RoleID == "1" ? "院方" :item.RoleID == "2" ? "医生" : item.RoleID == "3" ? "助手" : "患者")</td>
                            <td>@item.ProvinceName</td>
                            <td>@item.CityName</td>
                            <td>@item.HospitalName</td>
                            <td><a href="@Url.Action("Edit", "User", new {id=item.ID })"><i class="fa fa-edit"></i> <span>编辑</span></a></td>
                        </tr>
                    }
                </tbody>
            </table>
        </div><!-- table-responsive -->
        @Html.PagedListPager((PagedList.IPagedList)Model, page => Url.Action("Index", new
                           {
                               page,
                               adName = ViewBag.AdName
                           })
                            , PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(
                            new PagedListRenderOptions()
                            {
                                LinkToPreviousPageFormat = "上一页",
                                LinkToNextPageFormat = "下一页",
                                MaximumPageNumbersToDisplay = 5
                            }, new AjaxOptions()
                            {
                                HttpMethod = "GET"
                            }))
    </div><!-- row -->
</div>